add_rest_of_file (FILE *fp, FILE *fpout, char *buf, int buflen)
{
/* now add the rest of the file */
while (fgets (buf, buflen, fp) != NULLCHAR) {
kwait (NULL);
fputs (buf, fpout);
}
}
int
dombpasswd (int argc, char *argv[], void *p)
{
struct mbx *m;
char buf[MBXLINE], *cp = NULLCHAR;
char usrfilename[MBXLINE];
char tmpfilename[MBXLINE];
FILE *fp, *fpout;
int foundit = 0, changedit = 0;
char *searchfor;
char firstpass[60];
m = (struct mbx *) p;
if (argc > 1 && !(m->privs & SYSOP_CMD)) {
/* only a sysop can change other users' passwords */
tputs ("Sorry, but you do not have permission to change others' passwords.\n");
tputs ("Usage: passwd\n");
return 1;
}
if (m->privs & WAS_ANONY) {
/* anonymous users don't have defined passwords */
tputs ("Sorry, but anonymous users are not allowed to save/change passwords.\n");
return 1;
}
if (!m->authenticated) {
/* user has not already authenticated themself */
tputs ("Sorry, but you have not been authenticated for this login. You must be connect via AX25.\nSorry, but you are not allowed to change your password at this time.\n");
return 1;
}
if (!profileUsermod && !(m->privs & SYSOP_CMD)) {
/* disabled feature - by sysop */
tputs ("Sorry, but changing passwords is disabled by the sysop.\n");
{ "list", domblistprofile, 0, 2, "profile list <name>" },
{ NULLCHAR, NULL, 0, 0, NULLCHAR }
};
int
dombprofile (int argc, char *argv[], void *p)
{
return subcmd (MBProTab, argc, argv, p);
}
int
dombnewprofile (int argc, char *argv[], void *p)
{
struct mbx *m;
FILE *fp;
int level = 1;
char usrfilename[MBXLINE];
char buf[MBXLINE], *cp;
m = (struct mbx *) p;
if (!(m->privs & SYSOP_CMD)) {
/* only a sysop can change other users' passwords */
tputs ("Sorry, but you do not have permission to add a security profile!\n");
return 1;
}
if (!m->authenticated) {
/* user has not already authenticated themself */
tputs ("Sorry, but you have not been authenticated for this login. You must be connect via AX25.\nSorry, but you are not allowed to add a user profile at this time.\n");
return 1;
}
/* first check to see if this profile already exists */
tprintf ("New security profile for '%s' added successfully\n", argv[1]);
return 0;
}
int
dombchgprofile (int argc, char *argv[], void *p)
{
struct mbx *m;
FILE *fp, *fpout;
char buf[MBXLINE];
char usrfilename[MBXLINE];
char tmpfilename[MBXLINE];
int level = 1;
char *cp, *cp2;
int foundit = 0;
m = (struct mbx *) p;
if (!(m->privs & SYSOP_CMD)) {
/* only a sysop can change other users' passwords */
tputs ("Sorry, but you do not have permission to change a security profile!\n");
return 1;
}
if (!m->authenticated) {
/* user has not already authenticated themself */
tputs ("Sorry, but you have not been authenticated for this login. You must be connect via AX25.\nSorry, but you are not allowed to change a user profile at this time.\n");
/* only a sysop can change other users' passwords */
tputs ("Sorry, but you do not have permission to list a security profile!\n");
return 1;
}
if (!m->authenticated) {
/* user has not already authenticated themself */
tputs ("Sorry, but you have not been authenticated for this login. You must be connect via AX25.\nSorry, but you are not allowed to list a user profile at this time.\n");
/* only a sysop can change other users' passwords */
tputs ("Sorry, but you do not have permission to delete a security profile!\n");
return 1;
}
if (!m->authenticated) {
/* user has not already authenticated themself */
tputs ("Sorry, but you have not been authenticated for this login. You must be connect via AX25.\nSorry, but you are not allowed to delete a user profile at this time.\n");